home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / TEST / CYCLE_TE.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.0 KB  |  61 lines

  1.  
  2. package sub_arctic.test;
  3.  
  4. /* import various pieces of the sub_arctic toolkit that we need */
  5. import sub_arctic.lib.*;
  6. import sub_arctic.input.*;
  7. import sub_arctic.constraints.std_function;
  8.  
  9. public class cycle_test extends interactor_applet 
  10.   implements interactor_consts {
  11.  
  12.   /* initialization of sub_arctic interface when applet starts */
  13.   public void build_ui(base_parent_interactor top) 
  14.     {
  15.       button    goodbye;
  16.  
  17.       goodbye = new button(0,0, "Goodbye", null);
  18.       top.add_child(goodbye);
  19.  
  20.       /* build a cycle */
  21.       goodbye.set_x_constraint(std_function.offset(PARENT.W(), 1));
  22.       goodbye.parent().set_w_constraint(
  23.     std_function.offset(FIRST_CHILD.X2(),1));
  24.  
  25.     /* force cyclic eval */
  26.       System.err.print("Cycle (should ignore)=>");
  27.       System.err.println(goodbye.x());
  28.  
  29.     /* reset handling and do it again */
  30.       manager.handle_cycles_with(manager.EXCEPTION_PRINT_STACK); 
  31.       goodbye.mark_x_ood();
  32.       System.err.println("(should print stack trace)");
  33.       System.err.print("Cycle =>");
  34.       System.err.println(goodbye.x());
  35.  
  36.       /* reset handling and do it again */
  37.       manager.handle_cycles_with(manager.EXCEPTION_STACK_CRASH); 
  38.       goodbye.mark_x_ood();
  39.       System.err.println("(should print stack trace and exit)");
  40.       System.err.print("Cycle =>");
  41.       System.err.println(goodbye.x());
  42.     }
  43. }
  44.  
  45. /*=========================== COPYRIGHT NOTICE ===========================
  46.  
  47. This file is part of the subArctic user interface toolkit.
  48.  
  49. Copyright (c) 1996 Scott Hudson and Ian Smith
  50. All rights reserved.
  51.  
  52. The subArctic system is freely available for most uses under the terms
  53. and conditions described in 
  54.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  55. and appearing in full in the lib/interactor.java source file.
  56.  
  57. The current release and additional information about this software can be 
  58. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  59.  
  60. ========================================================================*/
  61.